<template>
  <view class="boxs">
    <view
      class="box"
      v-for="(item, index) in list"
      :key="index"
      @click="handelDetail(item.id, item.quotationType)"
    >
      <span>{{ item.quotationType=='sc'?'定制悬浮剂SC产品询价':'定制WP、SP产品询价'}}</span>
      <p><i>订单报价：</i>{{ item.totalPrice }}<b v-if="!zhongwen(item.totalPrice)">{{ item.quotationType=='sc'?'元/千升':'元/吨' }}</b></p>
	  <p><i>订单总量：</i>{{ item.totalAmount }}<b >{{ item.quotationType=='sc'?'升':'公斤' }}</b></p>
	  <p><i>报价时间：</i>{{ item.quotationDate }}</p>
    </view>
  </view>
</template>

<script>
// import countTo from "vue-count-to";
	import {
		list
	} from "@/config/api.js";
	
export default {
  // components: {
  //   countTo,
  // },
  data() {
    return {
      isLogin: false, //判断是否登录

      list: [
       
      ],
    };
  },
  methods: {
	  zhongwen(str) { // 匹配中文字符的正则表达式
	  	const reg = /[\u4e00-\u9fa5]/;
	  	return reg.test(str);
	  },
    async _getInfo() {
      await list({pageNum:1,
		pageSize:200}).then((res) => {
        this.list = res;
		console.log(this.list)
       
      });
    },
    handelDetail(id, type) {
      if (type == 'sc') {
        uni.navigateTo({
          url: `/pages/my/sc_more?id=${id}`,
        });
      } else {
        uni.navigateTo({
          url: `/pages/my/wp_more?id=${id}`,
        });
      }
    },

    go(e) {
      uni.navigateTo({
        url: e,
      });
    },
    // 确认
    confirm() {
      this.$store.dispatch("Logout").then(() => {
        this.modalShow = false;
        this.logout();
      });
    },
    //退出
    logout() {
      uni.removeStorageSync("loginTokens");
      uni.navigateTo({
        url: "/pages/login/login",
      });
    },
  },
  computed: {},
  onShow() {
    if (uni.getStorageSync("loginTokens")) {
      this._getInfo();
    }
  },
};
</script>
<style lang="scss">
	page{
  background: #f5f7fb;
	}
</style>
<style lang="scss" scoped>
page {
  background: #f5f7fb;
}
.boxs {
  width: 100vw;
  height: auto;
  background: #ffffff;
  display: block;
  float: left;
}
.box {
  width: 700rpx;
  margin: 0 25rpx 0;
  padding: 30rpx 0;
  border-bottom: 1px solid #dddddd;
  height: auto;
  background: #ffffff;
  display: block;
  float: left;
}
.box:last-child {
  border-bottom: 0;
}
.box span {
  width: 100%;
  height: auto;
  font-size: 30rpx;
  color: #1c2023;
  margin: 0 0 20rpx;
  display: block;
  float: left;
}
.box p {
  width: 100%;
  height: auto;
  font-size: 26rpx;

  color: #8a8a8a;
  margin: 0 0 10rpx;
  display: block;
  float: left;
}
.box p b{
	display: inline;
	float: none;
	padding: 0 0 0 10rpx;
}
.box p i {
  font-style: normal;
  display: block;
  float: left;
  margin: 0 30rpx 0 0;
  width: auto;
  height: auto;
}
</style>
